//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2022 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

import Foundation
import SotoCore

extension ServiceQuotas {
    // MARK: Enums

    public enum ErrorCode: String, CustomStringConvertible, Codable, _SotoSendable {
        case dependencyAccessDeniedError = "DEPENDENCY_ACCESS_DENIED_ERROR"
        case dependencyServiceError = "DEPENDENCY_SERVICE_ERROR"
        case dependencyThrottlingError = "DEPENDENCY_THROTTLING_ERROR"
        case serviceQuotaNotAvailableError = "SERVICE_QUOTA_NOT_AVAILABLE_ERROR"
        public var description: String { return self.rawValue }
    }

    public enum PeriodUnit: String, CustomStringConvertible, Codable, _SotoSendable {
        case day = "DAY"
        case hour = "HOUR"
        case microsecond = "MICROSECOND"
        case millisecond = "MILLISECOND"
        case minute = "MINUTE"
        case second = "SECOND"
        case week = "WEEK"
        public var description: String { return self.rawValue }
    }

    public enum RequestStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case approved = "APPROVED"
        case caseClosed = "CASE_CLOSED"
        case caseOpened = "CASE_OPENED"
        case denied = "DENIED"
        case pending = "PENDING"
        public var description: String { return self.rawValue }
    }

    public enum ServiceQuotaTemplateAssociationStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case associated = "ASSOCIATED"
        case disassociated = "DISASSOCIATED"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct AssociateServiceQuotaTemplateRequest: AWSEncodableShape {
        public init() {}
    }

    public struct AssociateServiceQuotaTemplateResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteServiceQuotaIncreaseRequestFromTemplateRequest: AWSEncodableShape {
        /// The AWS Region.
        public let awsRegion: String
        /// The quota identifier.
        public let quotaCode: String
        /// The service identifier.
        public let serviceCode: String

        public init(awsRegion: String, quotaCode: String, serviceCode: String) {
            self.awsRegion = awsRegion
            self.quotaCode = quotaCode
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, max: 64)
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, min: 1)
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,128}")
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, max: 128)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, min: 1)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,128}")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,63}")
        }

        private enum CodingKeys: String, CodingKey {
            case awsRegion = "AwsRegion"
            case quotaCode = "QuotaCode"
            case serviceCode = "ServiceCode"
        }
    }

    public struct DeleteServiceQuotaIncreaseRequestFromTemplateResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DisassociateServiceQuotaTemplateRequest: AWSEncodableShape {
        public init() {}
    }

    public struct DisassociateServiceQuotaTemplateResponse: AWSDecodableShape {
        public init() {}
    }

    public struct ErrorReason: AWSDecodableShape {
        /// Service Quotas returns the following error values:    DEPENDENCY_ACCESS_DENIED_ERROR - The caller does not have the required permissions to complete the action. To resolve the error, you must have permission to access the service or quota.    DEPENDENCY_THROTTLING_ERROR - The service is throttling Service Quotas.    DEPENDENCY_SERVICE_ERROR - The service is not available.    SERVICE_QUOTA_NOT_AVAILABLE_ERROR - There was an error in Service Quotas.
        public let errorCode: ErrorCode?
        /// The error message.
        public let errorMessage: String?

        public init(errorCode: ErrorCode? = nil, errorMessage: String? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
        }
    }

    public struct GetAWSDefaultServiceQuotaRequest: AWSEncodableShape {
        /// The quota identifier.
        public let quotaCode: String
        /// The service identifier.
        public let serviceCode: String

        public init(quotaCode: String, serviceCode: String) {
            self.quotaCode = quotaCode
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, max: 128)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, min: 1)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,128}")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,63}")
        }

        private enum CodingKeys: String, CodingKey {
            case quotaCode = "QuotaCode"
            case serviceCode = "ServiceCode"
        }
    }

    public struct GetAWSDefaultServiceQuotaResponse: AWSDecodableShape {
        /// Information about the quota.
        public let quota: ServiceQuota?

        public init(quota: ServiceQuota? = nil) {
            self.quota = quota
        }

        private enum CodingKeys: String, CodingKey {
            case quota = "Quota"
        }
    }

    public struct GetAssociationForServiceQuotaTemplateRequest: AWSEncodableShape {
        public init() {}
    }

    public struct GetAssociationForServiceQuotaTemplateResponse: AWSDecodableShape {
        /// The association status. If the status is ASSOCIATED, the quota increase requests in the template are automatically applied to new accounts in your organization.
        public let serviceQuotaTemplateAssociationStatus: ServiceQuotaTemplateAssociationStatus?

        public init(serviceQuotaTemplateAssociationStatus: ServiceQuotaTemplateAssociationStatus? = nil) {
            self.serviceQuotaTemplateAssociationStatus = serviceQuotaTemplateAssociationStatus
        }

        private enum CodingKeys: String, CodingKey {
            case serviceQuotaTemplateAssociationStatus = "ServiceQuotaTemplateAssociationStatus"
        }
    }

    public struct GetRequestedServiceQuotaChangeRequest: AWSEncodableShape {
        /// The ID of the quota increase request.
        public let requestId: String

        public init(requestId: String) {
            self.requestId = requestId
        }

        public func validate(name: String) throws {
            try self.validate(self.requestId, name: "requestId", parent: name, max: 128)
            try self.validate(self.requestId, name: "requestId", parent: name, min: 1)
            try self.validate(self.requestId, name: "requestId", parent: name, pattern: "[0-9a-zA-Z][a-zA-Z0-9-]{1,128}")
        }

        private enum CodingKeys: String, CodingKey {
            case requestId = "RequestId"
        }
    }

    public struct GetRequestedServiceQuotaChangeResponse: AWSDecodableShape {
        /// Information about the quota increase request.
        public let requestedQuota: RequestedServiceQuotaChange?

        public init(requestedQuota: RequestedServiceQuotaChange? = nil) {
            self.requestedQuota = requestedQuota
        }

        private enum CodingKeys: String, CodingKey {
            case requestedQuota = "RequestedQuota"
        }
    }

    public struct GetServiceQuotaIncreaseRequestFromTemplateRequest: AWSEncodableShape {
        /// The AWS Region.
        public let awsRegion: String
        /// The quota identifier.
        public let quotaCode: String
        /// The service identifier.
        public let serviceCode: String

        public init(awsRegion: String, quotaCode: String, serviceCode: String) {
            self.awsRegion = awsRegion
            self.quotaCode = quotaCode
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, max: 64)
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, min: 1)
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,128}")
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, max: 128)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, min: 1)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,128}")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,63}")
        }

        private enum CodingKeys: String, CodingKey {
            case awsRegion = "AwsRegion"
            case quotaCode = "QuotaCode"
            case serviceCode = "ServiceCode"
        }
    }

    public struct GetServiceQuotaIncreaseRequestFromTemplateResponse: AWSDecodableShape {
        /// Information about the quota increase request.
        public let serviceQuotaIncreaseRequestInTemplate: ServiceQuotaIncreaseRequestInTemplate?

        public init(serviceQuotaIncreaseRequestInTemplate: ServiceQuotaIncreaseRequestInTemplate? = nil) {
            self.serviceQuotaIncreaseRequestInTemplate = serviceQuotaIncreaseRequestInTemplate
        }

        private enum CodingKeys: String, CodingKey {
            case serviceQuotaIncreaseRequestInTemplate = "ServiceQuotaIncreaseRequestInTemplate"
        }
    }

    public struct GetServiceQuotaRequest: AWSEncodableShape {
        /// The quota identifier.
        public let quotaCode: String
        /// The service identifier.
        public let serviceCode: String

        public init(quotaCode: String, serviceCode: String) {
            self.quotaCode = quotaCode
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, max: 128)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, min: 1)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,128}")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,63}")
        }

        private enum CodingKeys: String, CodingKey {
            case quotaCode = "QuotaCode"
            case serviceCode = "ServiceCode"
        }
    }

    public struct GetServiceQuotaResponse: AWSDecodableShape {
        /// Information about the quota.
        public let quota: ServiceQuota?

        public init(quota: ServiceQuota? = nil) {
            self.quota = quota
        }

        private enum CodingKeys: String, CodingKey {
            case quota = "Quota"
        }
    }

    public struct ListAWSDefaultServiceQuotasRequest: AWSEncodableShape {
        /// The maximum number of results to return with a single call. To retrieve the remaining results, if any, make another call with the token returned from this call.
        public let maxResults: Int?
        /// The token for the next page of results.
        public let nextToken: String?
        /// The service identifier.
        public let serviceCode: String

        public init(maxResults: Int? = nil, nextToken: String? = nil, serviceCode: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[a-zA-Z0-9/+]*={0,2}$")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,63}")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case serviceCode = "ServiceCode"
        }
    }

    public struct ListAWSDefaultServiceQuotasResponse: AWSDecodableShape {
        /// The token to use to retrieve the next page of results. This value is null when there are no more results to return.
        public let nextToken: String?
        /// Information about the quotas.
        public let quotas: [ServiceQuota]?

        public init(nextToken: String? = nil, quotas: [ServiceQuota]? = nil) {
            self.nextToken = nextToken
            self.quotas = quotas
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case quotas = "Quotas"
        }
    }

    public struct ListRequestedServiceQuotaChangeHistoryByQuotaRequest: AWSEncodableShape {
        /// The maximum number of results to return with a single call. To retrieve the remaining results, if any, make another call with the token returned from this call.
        public let maxResults: Int?
        /// The token for the next page of results.
        public let nextToken: String?
        /// The quota identifier.
        public let quotaCode: String
        /// The service identifier.
        public let serviceCode: String
        /// The status value of the quota increase request.
        public let status: RequestStatus?

        public init(maxResults: Int? = nil, nextToken: String? = nil, quotaCode: String, serviceCode: String, status: RequestStatus? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.quotaCode = quotaCode
            self.serviceCode = serviceCode
            self.status = status
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[a-zA-Z0-9/+]*={0,2}$")
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, max: 128)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, min: 1)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,128}")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,63}")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case quotaCode = "QuotaCode"
            case serviceCode = "ServiceCode"
            case status = "Status"
        }
    }

    public struct ListRequestedServiceQuotaChangeHistoryByQuotaResponse: AWSDecodableShape {
        /// The token to use to retrieve the next page of results. This value is null when there are no more results to return.
        public let nextToken: String?
        /// Information about the quota increase requests.
        public let requestedQuotas: [RequestedServiceQuotaChange]?

        public init(nextToken: String? = nil, requestedQuotas: [RequestedServiceQuotaChange]? = nil) {
            self.nextToken = nextToken
            self.requestedQuotas = requestedQuotas
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case requestedQuotas = "RequestedQuotas"
        }
    }

    public struct ListRequestedServiceQuotaChangeHistoryRequest: AWSEncodableShape {
        /// The maximum number of results to return with a single call. To retrieve the remaining results, if any, make another call with the token returned from this call.
        public let maxResults: Int?
        /// The token for the next page of results.
        public let nextToken: String?
        /// The service identifier.
        public let serviceCode: String?
        /// The status of the quota increase request.
        public let status: RequestStatus?

        public init(maxResults: Int? = nil, nextToken: String? = nil, serviceCode: String? = nil, status: RequestStatus? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.serviceCode = serviceCode
            self.status = status
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[a-zA-Z0-9/+]*={0,2}$")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,63}")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case serviceCode = "ServiceCode"
            case status = "Status"
        }
    }

    public struct ListRequestedServiceQuotaChangeHistoryResponse: AWSDecodableShape {
        /// The token to use to retrieve the next page of results. This value is null when there are no more results to return.
        public let nextToken: String?
        /// Information about the quota increase requests.
        public let requestedQuotas: [RequestedServiceQuotaChange]?

        public init(nextToken: String? = nil, requestedQuotas: [RequestedServiceQuotaChange]? = nil) {
            self.nextToken = nextToken
            self.requestedQuotas = requestedQuotas
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case requestedQuotas = "RequestedQuotas"
        }
    }

    public struct ListServiceQuotaIncreaseRequestsInTemplateRequest: AWSEncodableShape {
        /// The AWS Region.
        public let awsRegion: String?
        /// The maximum number of results to return with a single call. To retrieve the remaining results, if any, make another call with the token returned from this call.
        public let maxResults: Int?
        /// The token for the next page of results.
        public let nextToken: String?
        /// The service identifier.
        public let serviceCode: String?

        public init(awsRegion: String? = nil, maxResults: Int? = nil, nextToken: String? = nil, serviceCode: String? = nil) {
            self.awsRegion = awsRegion
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, max: 64)
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, min: 1)
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,128}")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[a-zA-Z0-9/+]*={0,2}$")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,63}")
        }

        private enum CodingKeys: String, CodingKey {
            case awsRegion = "AwsRegion"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case serviceCode = "ServiceCode"
        }
    }

    public struct ListServiceQuotaIncreaseRequestsInTemplateResponse: AWSDecodableShape {
        /// The token to use to retrieve the next page of results. This value is null when there are no more results to return.
        public let nextToken: String?
        /// Information about the quota increase requests.
        public let serviceQuotaIncreaseRequestInTemplateList: [ServiceQuotaIncreaseRequestInTemplate]?

        public init(nextToken: String? = nil, serviceQuotaIncreaseRequestInTemplateList: [ServiceQuotaIncreaseRequestInTemplate]? = nil) {
            self.nextToken = nextToken
            self.serviceQuotaIncreaseRequestInTemplateList = serviceQuotaIncreaseRequestInTemplateList
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case serviceQuotaIncreaseRequestInTemplateList = "ServiceQuotaIncreaseRequestInTemplateList"
        }
    }

    public struct ListServiceQuotasRequest: AWSEncodableShape {
        /// The maximum number of results to return with a single call. To retrieve the remaining results, if any, make another call with the token returned from this call.
        public let maxResults: Int?
        /// The token for the next page of results.
        public let nextToken: String?
        /// The service identifier.
        public let serviceCode: String

        public init(maxResults: Int? = nil, nextToken: String? = nil, serviceCode: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[a-zA-Z0-9/+]*={0,2}$")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,63}")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case serviceCode = "ServiceCode"
        }
    }

    public struct ListServiceQuotasResponse: AWSDecodableShape {
        /// The token to use to retrieve the next page of results. This value is null when there are no more results to return.
        public let nextToken: String?
        /// Information about the quotas.
        public let quotas: [ServiceQuota]?

        public init(nextToken: String? = nil, quotas: [ServiceQuota]? = nil) {
            self.nextToken = nextToken
            self.quotas = quotas
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case quotas = "Quotas"
        }
    }

    public struct ListServicesRequest: AWSEncodableShape {
        /// The maximum number of results to return with a single call. To retrieve the remaining results, if any, make another call with the token returned from this call.
        public let maxResults: Int?
        /// The token for the next page of results.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[a-zA-Z0-9/+]*={0,2}$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListServicesResponse: AWSDecodableShape {
        /// The token to use to retrieve the next page of results. This value is null when there are no more results to return.
        public let nextToken: String?
        /// Information about the services.
        public let services: [ServiceInfo]?

        public init(nextToken: String? = nil, services: [ServiceInfo]? = nil) {
            self.nextToken = nextToken
            self.services = services
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case services = "Services"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) for the applied quota for which you want to list tags. You can get this information by using the Service Quotas console, or by listing the quotas using the list-service-quotas AWS CLI command or the ListServiceQuotas AWS API operation.
        public let resourceARN: String

        public init(resourceARN: String) {
            self.resourceARN = resourceARN
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, pattern: "arn:aws(-[\\w]+)*:*:.+:[0-9]{12}:.+")
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
        }
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// A complex data type that contains zero or more tag elements.
        public let tags: [Tag]?

        public init(tags: [Tag]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct MetricInfo: AWSDecodableShape {
        /// The metric dimension. This is a name/value pair that is part of the identity of a metric.
        public let metricDimensions: [String: String]?
        /// The name of the metric.
        public let metricName: String?
        /// The namespace of the metric.
        public let metricNamespace: String?
        /// The metric statistic that we recommend you use when determining quota usage.
        public let metricStatisticRecommendation: String?

        public init(metricDimensions: [String: String]? = nil, metricName: String? = nil, metricNamespace: String? = nil, metricStatisticRecommendation: String? = nil) {
            self.metricDimensions = metricDimensions
            self.metricName = metricName
            self.metricNamespace = metricNamespace
            self.metricStatisticRecommendation = metricStatisticRecommendation
        }

        private enum CodingKeys: String, CodingKey {
            case metricDimensions = "MetricDimensions"
            case metricName = "MetricName"
            case metricNamespace = "MetricNamespace"
            case metricStatisticRecommendation = "MetricStatisticRecommendation"
        }
    }

    public struct PutServiceQuotaIncreaseRequestIntoTemplateRequest: AWSEncodableShape {
        /// The AWS Region.
        public let awsRegion: String
        /// The new, increased value for the quota.
        public let desiredValue: Double
        /// The quota identifier.
        public let quotaCode: String
        /// The service identifier.
        public let serviceCode: String

        public init(awsRegion: String, desiredValue: Double, quotaCode: String, serviceCode: String) {
            self.awsRegion = awsRegion
            self.desiredValue = desiredValue
            self.quotaCode = quotaCode
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, max: 64)
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, min: 1)
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,128}")
            try self.validate(self.desiredValue, name: "desiredValue", parent: name, max: 10_000_000_000.0)
            try self.validate(self.desiredValue, name: "desiredValue", parent: name, min: 0.0)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, max: 128)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, min: 1)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,128}")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,63}")
        }

        private enum CodingKeys: String, CodingKey {
            case awsRegion = "AwsRegion"
            case desiredValue = "DesiredValue"
            case quotaCode = "QuotaCode"
            case serviceCode = "ServiceCode"
        }
    }

    public struct PutServiceQuotaIncreaseRequestIntoTemplateResponse: AWSDecodableShape {
        /// Information about the quota increase request.
        public let serviceQuotaIncreaseRequestInTemplate: ServiceQuotaIncreaseRequestInTemplate?

        public init(serviceQuotaIncreaseRequestInTemplate: ServiceQuotaIncreaseRequestInTemplate? = nil) {
            self.serviceQuotaIncreaseRequestInTemplate = serviceQuotaIncreaseRequestInTemplate
        }

        private enum CodingKeys: String, CodingKey {
            case serviceQuotaIncreaseRequestInTemplate = "ServiceQuotaIncreaseRequestInTemplate"
        }
    }

    public struct QuotaPeriod: AWSDecodableShape {
        /// The time unit.
        public let periodUnit: PeriodUnit?
        /// The value.
        public let periodValue: Int?

        public init(periodUnit: PeriodUnit? = nil, periodValue: Int? = nil) {
            self.periodUnit = periodUnit
            self.periodValue = periodValue
        }

        private enum CodingKeys: String, CodingKey {
            case periodUnit = "PeriodUnit"
            case periodValue = "PeriodValue"
        }
    }

    public struct RequestServiceQuotaIncreaseRequest: AWSEncodableShape {
        /// The new, increased value for the quota.
        public let desiredValue: Double
        /// The quota identifier.
        public let quotaCode: String
        /// The service identifier.
        public let serviceCode: String

        public init(desiredValue: Double, quotaCode: String, serviceCode: String) {
            self.desiredValue = desiredValue
            self.quotaCode = quotaCode
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.desiredValue, name: "desiredValue", parent: name, max: 10_000_000_000.0)
            try self.validate(self.desiredValue, name: "desiredValue", parent: name, min: 0.0)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, max: 128)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, min: 1)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,128}")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "[a-zA-Z][a-zA-Z0-9-]{1,63}")
        }

        private enum CodingKeys: String, CodingKey {
            case desiredValue = "DesiredValue"
            case quotaCode = "QuotaCode"
            case serviceCode = "ServiceCode"
        }
    }

    public struct RequestServiceQuotaIncreaseResponse: AWSDecodableShape {
        /// Information about the quota increase request.
        public let requestedQuota: RequestedServiceQuotaChange?

        public init(requestedQuota: RequestedServiceQuotaChange? = nil) {
            self.requestedQuota = requestedQuota
        }

        private enum CodingKeys: String, CodingKey {
            case requestedQuota = "RequestedQuota"
        }
    }

    public struct RequestedServiceQuotaChange: AWSDecodableShape {
        /// The case ID.
        public let caseId: String?
        /// The date and time when the quota increase request was received and the case ID was created.
        public let created: Date?
        /// The new, increased value for the quota.
        public let desiredValue: Double?
        /// Indicates whether the quota is global.
        public let globalQuota: Bool?
        /// The unique identifier.
        public let id: String?
        /// The date and time of the most recent change.
        public let lastUpdated: Date?
        /// The Amazon Resource Name (ARN) of the quota.
        public let quotaArn: String?
        /// The quota identifier.
        public let quotaCode: String?
        /// The quota name.
        public let quotaName: String?
        /// The IAM identity of the requester.
        public let requester: String?
        /// The service identifier.
        public let serviceCode: String?
        /// The service name.
        public let serviceName: String?
        /// The state of the quota increase request.
        public let status: RequestStatus?
        /// The unit of measurement.
        public let unit: String?

        public init(caseId: String? = nil, created: Date? = nil, desiredValue: Double? = nil, globalQuota: Bool? = nil, id: String? = nil, lastUpdated: Date? = nil, quotaArn: String? = nil, quotaCode: String? = nil, quotaName: String? = nil, requester: String? = nil, serviceCode: String? = nil, serviceName: String? = nil, status: RequestStatus? = nil, unit: String? = nil) {
            self.caseId = caseId
            self.created = created
            self.desiredValue = desiredValue
            self.globalQuota = globalQuota
            self.id = id
            self.lastUpdated = lastUpdated
            self.quotaArn = quotaArn
            self.quotaCode = quotaCode
            self.quotaName = quotaName
            self.requester = requester
            self.serviceCode = serviceCode
            self.serviceName = serviceName
            self.status = status
            self.unit = unit
        }

        private enum CodingKeys: String, CodingKey {
            case caseId = "CaseId"
            case created = "Created"
            case desiredValue = "DesiredValue"
            case globalQuota = "GlobalQuota"
            case id = "Id"
            case lastUpdated = "LastUpdated"
            case quotaArn = "QuotaArn"
            case quotaCode = "QuotaCode"
            case quotaName = "QuotaName"
            case requester = "Requester"
            case serviceCode = "ServiceCode"
            case serviceName = "ServiceName"
            case status = "Status"
            case unit = "Unit"
        }
    }

    public struct ServiceInfo: AWSDecodableShape {
        /// The service identifier.
        public let serviceCode: String?
        /// The service name.
        public let serviceName: String?

        public init(serviceCode: String? = nil, serviceName: String? = nil) {
            self.serviceCode = serviceCode
            self.serviceName = serviceName
        }

        private enum CodingKeys: String, CodingKey {
            case serviceCode = "ServiceCode"
            case serviceName = "ServiceName"
        }
    }

    public struct ServiceQuota: AWSDecodableShape {
        /// Indicates whether the quota value can be increased.
        public let adjustable: Bool?
        /// The error code and error reason.
        public let errorReason: ErrorReason?
        /// Indicates whether the quota is global.
        public let globalQuota: Bool?
        /// The period of time.
        public let period: QuotaPeriod?
        /// The Amazon Resource Name (ARN) of the quota.
        public let quotaArn: String?
        /// The quota identifier.
        public let quotaCode: String?
        /// The quota name.
        public let quotaName: String?
        /// The service identifier.
        public let serviceCode: String?
        /// The service name.
        public let serviceName: String?
        /// The unit of measurement.
        public let unit: String?
        /// Information about the measurement.
        public let usageMetric: MetricInfo?
        /// The quota value.
        public let value: Double?

        public init(adjustable: Bool? = nil, errorReason: ErrorReason? = nil, globalQuota: Bool? = nil, period: QuotaPeriod? = nil, quotaArn: String? = nil, quotaCode: String? = nil, quotaName: String? = nil, serviceCode: String? = nil, serviceName: String? = nil, unit: String? = nil, usageMetric: MetricInfo? = nil, value: Double? = nil) {
            self.adjustable = adjustable
            self.errorReason = errorReason
            self.globalQuota = globalQuota
            self.period = period
            self.quotaArn = quotaArn
            self.quotaCode = quotaCode
            self.quotaName = quotaName
            self.serviceCode = serviceCode
            self.serviceName = serviceName
            self.unit = unit
            self.usageMetric = usageMetric
            self.value = value
        }

        private enum CodingKeys: String, CodingKey {
            case adjustable = "Adjustable"
            case errorReason = "ErrorReason"
            case globalQuota = "GlobalQuota"
            case period = "Period"
            case quotaArn = "QuotaArn"
            case quotaCode = "QuotaCode"
            case quotaName = "QuotaName"
            case serviceCode = "ServiceCode"
            case serviceName = "ServiceName"
            case unit = "Unit"
            case usageMetric = "UsageMetric"
            case value = "Value"
        }
    }

    public struct ServiceQuotaIncreaseRequestInTemplate: AWSDecodableShape {
        /// The AWS Region.
        public let awsRegion: String?
        /// The new, increased value of the quota.
        public let desiredValue: Double?
        /// Indicates whether the quota is global.
        public let globalQuota: Bool?
        /// The quota identifier.
        public let quotaCode: String?
        /// The quota name.
        public let quotaName: String?
        /// The service identifier.
        public let serviceCode: String?
        /// The service name.
        public let serviceName: String?
        /// The unit of measurement.
        public let unit: String?

        public init(awsRegion: String? = nil, desiredValue: Double? = nil, globalQuota: Bool? = nil, quotaCode: String? = nil, quotaName: String? = nil, serviceCode: String? = nil, serviceName: String? = nil, unit: String? = nil) {
            self.awsRegion = awsRegion
            self.desiredValue = desiredValue
            self.globalQuota = globalQuota
            self.quotaCode = quotaCode
            self.quotaName = quotaName
            self.serviceCode = serviceCode
            self.serviceName = serviceName
            self.unit = unit
        }

        private enum CodingKeys: String, CodingKey {
            case awsRegion = "AwsRegion"
            case desiredValue = "DesiredValue"
            case globalQuota = "GlobalQuota"
            case quotaCode = "QuotaCode"
            case quotaName = "QuotaName"
            case serviceCode = "ServiceCode"
            case serviceName = "ServiceName"
            case unit = "Unit"
        }
    }

    public struct Tag: AWSEncodableShape & AWSDecodableShape {
        /// A string that contains a tag key. The string length should be between 1 and 128 characters. Valid characters include a-z, A-Z, 0-9, space, and the special characters _ - . : / = + @.
        public let key: String
        /// A string that contains an optional tag value. The string length should be between 0 and 256 characters. Valid characters include a-z, A-Z, 0-9, space, and the special characters _ - . : / = + @.
        public let value: String

        public init(key: String, value: String) {
            self.key = key
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 128)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.key, name: "key", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            try self.validate(self.value, name: "value", parent: name, max: 256)
            try self.validate(self.value, name: "value", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case value = "Value"
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) for the applied quota. You can get this information by using the Service Quotas console, or by listing the quotas using the list-service-quotas AWS CLI command or the ListServiceQuotas AWS API operation.
        public let resourceARN: String
        /// The tags that you want to add to the resource.
        public let tags: [Tag]

        public init(resourceARN: String, tags: [Tag]) {
            self.resourceARN = resourceARN
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, pattern: "arn:aws(-[\\w]+)*:*:.+:[0-9]{12}:.+")
            try self.tags.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tags = "Tags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) for the applied quota that you want to untag. You can get this information by using the Service Quotas console, or by listing the quotas using the list-service-quotas AWS CLI command or the ListServiceQuotas AWS API operation.
        public let resourceARN: String
        /// The keys of the tags that you want to remove from the resource.
        public let tagKeys: [String]

        public init(resourceARN: String, tagKeys: [String]) {
            self.resourceARN = resourceARN
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, pattern: "arn:aws(-[\\w]+)*:*:.+:[0-9]{12}:.+")
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
                try validate($0, name: "tagKeys[]", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tagKeys = "TagKeys"
        }
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }
}

// MARK: - Errors

/// Error enum for ServiceQuotas
public struct ServiceQuotasErrorType: AWSErrorType {
    enum Code: String {
        case accessDeniedException = "AccessDeniedException"
        case awsServiceAccessNotEnabledException = "AWSServiceAccessNotEnabledException"
        case dependencyAccessDeniedException = "DependencyAccessDeniedException"
        case illegalArgumentException = "IllegalArgumentException"
        case invalidPaginationTokenException = "InvalidPaginationTokenException"
        case invalidResourceStateException = "InvalidResourceStateException"
        case noAvailableOrganizationException = "NoAvailableOrganizationException"
        case noSuchResourceException = "NoSuchResourceException"
        case organizationNotInAllFeaturesModeException = "OrganizationNotInAllFeaturesModeException"
        case quotaExceededException = "QuotaExceededException"
        case resourceAlreadyExistsException = "ResourceAlreadyExistsException"
        case serviceException = "ServiceException"
        case serviceQuotaTemplateNotInUseException = "ServiceQuotaTemplateNotInUseException"
        case tagPolicyViolationException = "TagPolicyViolationException"
        case templatesNotAvailableInRegionException = "TemplatesNotAvailableInRegionException"
        case tooManyRequestsException = "TooManyRequestsException"
        case tooManyTagsException = "TooManyTagsException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize ServiceQuotas
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// You do not have sufficient permission to perform this action.
    public static var accessDeniedException: Self { .init(.accessDeniedException) }
    /// The action you attempted is not allowed unless Service Access with Service Quotas is enabled in your organization.
    public static var awsServiceAccessNotEnabledException: Self { .init(.awsServiceAccessNotEnabledException) }
    /// You can&#39;t perform this action because a dependency does not have access.
    public static var dependencyAccessDeniedException: Self { .init(.dependencyAccessDeniedException) }
    /// Invalid input was provided.
    public static var illegalArgumentException: Self { .init(.illegalArgumentException) }
    /// Invalid input was provided.
    public static var invalidPaginationTokenException: Self { .init(.invalidPaginationTokenException) }
    /// The resource is in an invalid state.
    public static var invalidResourceStateException: Self { .init(.invalidResourceStateException) }
    /// The account making this call is not a member of an organization.
    public static var noAvailableOrganizationException: Self { .init(.noAvailableOrganizationException) }
    /// The specified resource does not exist.
    public static var noSuchResourceException: Self { .init(.noSuchResourceException) }
    /// The organization that your account belongs to is not in All Features mode.
    public static var organizationNotInAllFeaturesModeException: Self { .init(.organizationNotInAllFeaturesModeException) }
    /// You have exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use Service Quotas to request a service quota increase.
    public static var quotaExceededException: Self { .init(.quotaExceededException) }
    /// The specified resource already exists.
    public static var resourceAlreadyExistsException: Self { .init(.resourceAlreadyExistsException) }
    /// Something went wrong.
    public static var serviceException: Self { .init(.serviceException) }
    /// The quota request template is not associated with your organization.
    public static var serviceQuotaTemplateNotInUseException: Self { .init(.serviceQuotaTemplateNotInUseException) }
    /// The specified tag is a reserved word and cannot be used.
    public static var tagPolicyViolationException: Self { .init(.tagPolicyViolationException) }
    /// The Service Quotas template is not available in this AWS Region.
    public static var templatesNotAvailableInRegionException: Self { .init(.templatesNotAvailableInRegionException) }
    /// Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase for this quota.
    public static var tooManyRequestsException: Self { .init(.tooManyRequestsException) }
    /// You&#39;ve exceeded the number of tags allowed for a resource. For more information, see Tag restrictions in the Service Quotas User Guide.
    public static var tooManyTagsException: Self { .init(.tooManyTagsException) }
}

extension ServiceQuotasErrorType: Equatable {
    public static func == (lhs: ServiceQuotasErrorType, rhs: ServiceQuotasErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension ServiceQuotasErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
